package com.bo.lock.sync;

/**
 * @Author: gpb
 * @Date: 2024/8/23 10:31
 * @Description:
 */
public class SyncITest {
    public static void main (String[] args) {
        // 锁的是TSync.class 类锁
        TSync.a();

        TSync tSync = new TSync();
        // 锁的是tSync对象,对象锁
        tSync.b();
    }

}
class TSync {
    public static synchronized void a(){
        System.out.println("hello word");
    }
    public  synchronized void b(){
        System.out.println("hello word");
    }
}